package com.tianqingwl.gsystem.install.pojo;

import cn.hutool.core.io.FileUtil;

import java.io.File;

/**
 * 安装状态
 */
public class InstallStatus {
    private static Boolean installed = null;

    public static boolean notInstall() {
        return !isInstall();
    }

    public static boolean isInstall() {
        if (installed == null) {
            init();
        }
        return installed;
    }

    private static void init() {

        File dbConfig = new File(FileUtil.getAbsolutePath("config" + File.separator + "application.yml"));
        installed = dbConfig.exists() && dbConfig.isFile();

    }

    public static void setInstalled(boolean installed) {
        InstallStatus.installed = installed;
    }
}
